package com.example.photo.model.VO;

import com.example.photo.model.domain.Contest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 赛事信息对象
 *
 * @author Lwh
 * @time 2023/03/29 17:15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ContestVO {
    //赛事id
    private Integer contestId;
    //主图
    private String bannerPic;
    //主题
    private String title;
    //副标题
    private String subtitle;
    //开始时间
    private LocalDateTime startTime;
    //结束时间
    private LocalDateTime stopTime;
    //介绍
    private String introductionPic;
    //比赛状态
    private Integer status;
    //尾图
    private String tailPic;
    //问卷链接
    private String questionnaire;

    //奖项列表
    private Map<Integer, List<PrizeVO>> prizes;

    public ContestVO(Contest contest) {
        this.contestId = contest.getContestId();
        this.bannerPic = contest.getBannerPic();
        this.title = contest.getTitle();
        this.subtitle = contest.getSubtitle();
        this.startTime = contest.getStartTime();
        this.stopTime = contest.getStopTime();
        this.introductionPic = contest.getIntroductionPic();
        this.status = contest.getStatus();
        this.tailPic = contest.getTailPic();
        this.questionnaire = contest.getQuestionnaire();
    }
}
